package cn.jbt.api.admin.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.jbt.api.admin.annotation.Log;
import cn.jbt.api.admin.entity.XxlJobGroup;
import cn.jbt.api.admin.service.IXxlJobGroupService;
import cn.jbt.common.PageQryParam;
import cn.jbt.common.PageQryResult;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/xxlJob/group")
@Slf4j
@AllArgsConstructor
public class XxlJobGroupController {

    private final IXxlJobGroupService iXxlJobGroupService;

    @PostMapping("/list")
    @SaCheckPermission("xxlJob:group:list")
    @Log(bizType = "查询", bizName = "分页查询执行器信息")
    public PageQryResult<XxlJobGroup> getAllByPage(@Valid @RequestBody PageQryParam<XxlJobGroup> pageQryParam) {
        return iXxlJobGroupService.getAllByPage(pageQryParam);
    }

}
